package com.study.customer.controller;

import com.study.customer.client.ShopClient;
import com.study.customer.controller.clients.OrderClient;
import com.study.customer.controller.dto.OrderDto;
import com.study.customer.pojo.GameOrder;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

/**
 * customer开放的order-api
 * 功能介绍：下单，查询订单
 *
 * @author peng
 */
@RestController
@RequestMapping("/order")
public class GameOrderController {

    @Autowired
    private OrderClient orderClient;

    @PostMapping
    public GameOrder orderGames(@RequestBody OrderDto orderDto) {
        return orderClient.orderGames(orderDto);
    }

    @GetMapping("/{id}")
    public GameOrder getById(@PathVariable Long id) {
        return orderClient.getById(id);
    }
}


